home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_300
/
310_02
/
set.st
< prev
next >
Wrap
Text File
|
1990-04-18
|
531b
|
26 lines
Class Set :Collection
| list |
[
new
list <- List new
| add: newElement
(list includes: newElement)
ifFalse: [list add: newElement]
| remove: oldElement ifAbsent: exceptionBlock
list remove: oldElement ifAbsent: exceptionBlock
| size
^ list size
| occurrencesOf: anElement
^ (list includes: anElement) ifTrue: [1] ifFalse: [0]
| first
^ list first
| next
^ list next
]